from django.contrib import admin
from django.urls import path, include
from mysite import views

# URL模式列表
urlpatterns = [
    path('', views.index),  # 调用index视图函数
    path('news/', include('news.urls')),  # 包含news应用的URL模式
    path('ckeditor/', include('ckeditor_uploader.urls')),  # 包含CKEditor上传器的URL模式
    path('admin/', admin.site.urls),  # admin管理后台的URL
]

# 将媒体文件的 URL 路由配置添加到 urlpatterns 中
from django.conf import settings
from django.conf.urls.static import static

urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)